﻿using ModernShopping.AppCode;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ModernShopping.WebUserControls
{
    public partial class UCMenuTaiKhoan : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session.GetLoginInfo() != null)
                {
                    LoginInfo loginInfo = Session.GetLoginInfo();
                    ImgAvatar.ImageUrl = loginInfo.ImageURL;
                    lblHelloUser.Text = loginInfo.CompanyName;
                    MultiView.SetActiveView(ViewDaDangNhap);
                }
            }
        }

        protected void DangXuat_Click(object sender, EventArgs e)
        {
            Session.RemoveLoginInfo();
            Request.RemoveLoginInfo(Response);
            FormsAuthentication.SignOut();
            Response.GoToHomePage(Request);
        }
    }
}